//
//  ZSTopDownHUD.h
//  CheFu365
//  模仿QQ顶部通知HUD
//  Created by safiri on 2017/9/25.
//  Copyright © 2017年 safiri. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "ZSTopDownView.h"

NS_ASSUME_NONNULL_BEGIN
/// 手势点击了本HUD回调
typedef void(^TapZSTopDownHUD)(void);
/// 隐藏HUD完成后回调
typedef void(^HideHudCompletion)(void);

@interface ZSTopDownHUD : NSObject

/// 几秒后开始隐藏动画
@property (nonatomic ,assign) NSInteger timeIntervalToHide;
@property (nonatomic ,copy ,nullable) TapZSTopDownHUD didTapHudBlock;
@property (nonatomic ,copy ,nullable) HideHudCompletion hideHudCompletionBlock;

/// 单例
+ (ZSTopDownHUD *)shareHUD;



/**
 显示HUD

 @param type HUD不同UI类型
 @param hintText HUD提示文本
 */
- (void)showHUDWithType:(HUDViewType)type hint:(nullable NSString *)hintText;
/**
 显示HUD 0.7秒后自动隐藏
 
 @param type HUD type
 @param hintText 提示文本
 */
+ (void)showHUDAutoHideWithType:(HUDViewType)type hint:(nullable NSString *)hintText;

/**
 设置并显示HUD

 @param type HUD type
 @param hintImage 提示图片
 @param hintText 提示文本
 @param textColor 提示文本颜色
 @param backgroundColor HUD背景色,默认白色
 */
- (void)showHUDWithType:(HUDViewType)type
                  image:(nullable UIImage *)hintImage
                   hint:(nullable NSString *)hintText
          hintTextColor:(nullable UIColor *)textColor
        backgroundColor:(nullable UIColor *)backgroundColor;
+ (void)showHUDAutoHideWithType:(HUDViewType)type
                  image:(nullable UIImage *)hintImage
                   hint:(nullable NSString *)hintText
          hintTextColor:(nullable UIColor *)textColor
        backgroundColor:(nullable UIColor *)backgroundColor;

/**
 几秒后隐藏HUD

 @param timeInterval 指定几秒后隐藏
 @param completion 隐藏完成回调
 */
- (void)hideHUDWithTimeIntervalToHide:(NSTimeInterval)timeInterval completion:(nullable HideHudCompletion)completion;

/**
 立即隐藏HUD

 @param completion 隐藏完成回调
 */
- (void)hideHUDImmediatelyCompletion:(nullable HideHudCompletion)completion;


/**
 手势点击了HUD回调

 @param didTapHUDCallBack 点击了HUD回调
 */
- (void)tapHUD:(nullable TapZSTopDownHUD)didTapHUDCallBack;
@end

NS_ASSUME_NONNULL_END
